/**
 * 
 */
package org.client.tools;

import java.io.IOException;
import java.io.ObjectOutputStream;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;

import org.client.ui.IMChatView;
import org.client.ui.IMMainWnd;
import org.client.view.manage.Client2ServerThread;
import org.pojo.User;
import org.pojo.Message.Message;

/**
 * @author 
 * @time 2012-6-17 下午02:59:52
 *
 */
public class ClientTool {
	public static IMMainWnd mainWnd;
	public static User currentUser;
	//public static int currentUserid;
	//public static HashMap<Integer,User> allfriends= new HashMap<Integer,User>();//所有人员
	public static HashMap<Integer,IMChatView> clientviews = new HashMap<Integer,IMChatView>();//用好友账号标识 聊天窗口。只有单聊
	public static List<User> onlinefriends = new LinkedList<User>();   //只传id, nickname, show.等信息 
	public  static void sendMsg(Message msg)
	{
		msg.setSenderId(currentUser.getUserid());
		ObjectOutputStream oos = Client2ServerThread.oos;
		try {
			oos.writeObject(msg);
			System.out.println("消息发送成功");
		} catch (IOException e) {
			// TODO Auto-generated catch block
			System.out.println("消息发发送失败");
			//消息发发送失败
			e.printStackTrace();
		}
	}
}
